package com.yys.gulimall.third.controller;/*
 * @author zq
 */

import com.yys.common.utils.R;
import com.yys.gulimall.third.component.SmsComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sms")
public class SmsSendController {

    @Autowired
    private SmsComponent smsComponent;

    /**
     * 提供给别的服务进行调用
     */
    @GetMapping("/sendCode")
    public R sendCode(@RequestParam("phone") String phone,
                      @RequestParam("code") String code) {
        smsComponent.sendSmSCode(phone,code);
        return R.ok();
    }
}
